<template>
  <div
    class="status-card"
    :class="{ b: borderColor && borderColor.length === 7 }"
    :style="`border-color: ${borderColor}`"
  >
    <div class="top">
      <div class="l">
        <img v-if="[1, 2, 3, 4].indexOf(t) !== -1" :src="icon[t]" alt="" />
        <div class="title">
          <slot name="title"></slot>
        </div>
      </div>
      <div class="r">
        <slot name="action"></slot>
      </div>
    </div>
    <div class="card-c">
      <slot></slot>
    </div>
  </div>
</template>

<script>
const success = require("./img/success.svg");
const danger = require("./img/danger.svg");
const warning = require("./img/warning.svg");
export default {
  props: {
    t: [String, Number],
    borderColor: String,
  },
  data() {
    return {
      icon: {
        1: success,
        2: success,
        3: warning,
        4: danger,
      },
    };
  },
  methods: {},
  mounted: function() {},
  components: {},
};
</script>
<style lang="scss" scoped>
.status-card {
  width: 100%;
  border-radius: 6px;
  overflow: hidden;
  padding: 10px 30px;
  background-color: #262937;
  margin-bottom: 10px;
  &.b {
    border-left: 4px solid;
  }
  .top {
    width: 100%;
    height: 45px;
    border-bottom: 1px solid #1c1e2e;
    display: flex;
    align-items: center;
    justify-content: space-between;
    .l {
      height: 100%;
      flex: 1;
      display: flex;
      align-items: center;
      .title {
        color: #fff;
        font-size: 16px;
      }
    }
    .r {
      color: #fff;
    }
    img {
      width: 17.5px;
      height: 17.5px;
      margin-right: 6px;
    }
  }
  .card-c {
    color: #fff;
    margin-bottom: 20px;
  }
}
</style>
